#include <iostream>
using std::cout;
using std::endl;

class Base
{
public:
	Base()
	{
		++m_count;
	}
	~Base()
	{
		--m_count;
	}
	
	static int getCount()
	{
		return m_count;
	}
	
	static void setCount(int count)
	{
		m_count = count;
	}
	
private:
	static int m_count;
};

int Base::m_count = 0;

class Derived1 : public Base
{
public:
	Derived1()
	{
		//setCount(getCount() + 1);
	}
	~Derived1()
	{
		//setCount(getCount() - 1);
	}
	
};

class Derived2 : public Base
{
public:
	Derived2()
	{
		//setCount(getCount() + 1);
	}
	~Derived2()
	{
		//setCount(getCount() - 1);
	}
	
};

int main()
{
	Derived1 d11;
	Derived1 d12;
	Derived1 d13;
	cout << Derived1::getCount() << endl;
	
	Derived2 d21;
	cout << Derived2::getCount() << endl;
	
	return 0;
}
